import request from "@/utils/request";

/**
 * 四大交易-委托交易
 * @param {*} params
 */

// 分页查询
export function entrustPageByQo(params) {
  return request({
    url: "/dinner/entrust/pageByQo",
    method: "post",
    params
  });
}

// 单个查询（详情）
export function entrustGetById(id) {
  return request({
    url: "/dinner/entrust/getById",
    method: "post",
    params: {
      id
    }
  });
}

// 添加
export function entrustSave(params) {
  return request({
    url: "/dinner/entrust/save",
    method: "post",
    params
  });
}

// 取消订单
export function entrustCancel(params) {
  return request({
    url: "/dinner/entrust/cancel",
    method: "post",
    params
  });
}

/**
 * 四大交易-集采交易
 */

// 分页查询
export function focusPageByQo(params) {
  return request({
    url: "/dinner/focus/pageByQo",
    method: "post",
    params
  });
}

// 单个查询（详情）
export function focusGetById(id) {
  return request({
    url: "/dinner/focus/getById",
    method: "post",
    params: {
      id
    }
  });
}

// 添加
export function focusSave(params) {
  return request({
    url: "/dinner/focus/save",
    method: "post",
    params
  });
}

// 取消
export function focusCancel(params) {
  return request({
    url: "/dinner/focus/cancel",
    method: "post",
    params
  });
}

// 报名分页查询
export function focusDetailPageByQo(params) {
  return request({
    url: "/dinner/focus/detail/pageByQo",
    method: "post",
    params
  });
}
// 取消报名
export function focusDetailCancel(params) {
  return request({
    url: "/dinner/focus/detail/cancel",
    method: "post",
    params
  });
}

/**
 * 四大交易-竞价交易
 */

// 分页查询
export function biddingPageByQo(params) {
  return request({
    url: "/dinner/bidding/pageByQo",
    method: "post",
    params
  });
}

// 单个查询（详情）
export function biddingGetById(id) {
  return request({
    url: "/dinner/bidding/getById",
    method: "post",
    params: {
      id
    }
  });
}

// 添加
export function biddingSave(params) {
  return request({
    url: "/dinner/bidding/save",
    method: "post",
    params
  });
}

// 取消竞价
export function biddingCancel(params) {
  return request({
    url: "/dinner/bidding/cancel",
    method: "post",
    params
  });
}

// 报名分页查询
export function biddingDetailPageByQo(params) {
  return request({
    url: "/dinner/bidding/detail/pageByQo",
    method: "post",
    params
  });
}

/**
 * 四大交易-挂牌交易
 */

// 分页查询
export function matchPageByQo(params) {
  return request({
    url: "/dinner/match/pageByQo",
    method: "post",
    params
  });
}

// 单个查询（详情）
export function matchGetById(id) {
  return request({
    url: "/dinner/match/getById",
    method: "post",
    params: {
      id
    }
  });
}

// 添加、修改(type有值为修改)
export function matchSave(params, type) {
  return request({
    url: type ? "/dinner/match/update" : "/dinner/match/save",
    method: "post",
    params
  });
}

// 取消
export function matchCancel(params) {
  return request({
    url: "/dinner/match/cancel",
    method: "post",
    params
  });
}

// 确认
export function matchConfirm(params) {
  return request({
    url: "/dinner/match/confirm",
    method: "post",
    params
  });
}

// 报名分页查询
export function matchDetailPageByQo(params) {
  return request({
    url: "/dinner/match/detail/pageByQo",
    method: "post",
    params
  });
}
